Dirty data protection for cache memories

ABSTRACT

A method is described for protecting dirty data in cache memories in a cost-effective manner. When an instruction to write data to a memory location is received, and that memory location is being cached, the data is written to a plurality of cache lines, which are referred to as duplicate cache lines. When the data is written back to memory, one of the duplicate cache lines is read. If the cache line is not corrupt, it is written back to the appropriate memory location and marked available. In one embodiment, if more duplicate cache lines exist, they are invalidated. In another embodiment, the other corresponding cache lines may be read for the highest confidence of reliability, and then marked clean or invalid.

COPYRIGHT NOTICE

[0001] A portion of the disclosure of this patent document containsmaterial which is subject to copyright protection. The copyright ownerhas no objection to the facsimile reproduction by anyone of the patentdocument or the patent disclosure as it appears in the Patent andTrademark Office patent file or records, but otherwise reserves allcopyright rights whatsoever. The following notice applies to thesoftware and data as described below and in the drawings hereto:Copyright© 2001, Sun Microsystems, Inc., All Rights Reserved.

FIELD OF THE INVENTION

[0002] This invention relates to the field of cache memories, and to amethod for protecting dirty data in cache memories.

BACKGROUND OF THE INVENTION

[0003] Computer memories take many different forms. The slowestmemories, and usually the farthest from the central processing unit(CPU), are virtual memories, such as a disk drive. The fastest, andusually the nearest, memories, include main memory, registers, andcaches. Of these, main memory is the slowest. Since caches are closer tothe CPU, they allow information, such as recently used instructionsand/or data, to be quickly accessed by the CPU. However, since cachesare relatively expensive, and limited in size, the data that can bestored on a cache memory is limited.

[0004] Cache memories can be used to store read-only data and read/writedata. When read-only data is cached, data that is read from a memory canbe stored in a cache so that the next time the data needs to be read, itcan be read from the faster cache rather than the slower system memory.An example of read-only data that is cache read from memory isinstructions to a program. Read-only data is not prone to data losssince any data that gets corrupted in the cache can always be read frommemory.

[0005] When read/write data is cached, data that is to be written tosystem memory can be written to the cache instead. The way that a cachehandles writes is called the “write policy” of the cache. There aredifferent write policies, two of which are described below.

[0006] A cache can be a write-back cache. When a write is made to systemmemory at a location that is currently cached, the new data is onlywritten to the cache, and not to the system memory. Correspondingly, ifanother memory location needs to use the cache line where this data isstored, the currently stored data needs to be saved—i.e., writtenback—to the system memory so that the line can be used by the new memorylocation.

[0007] A cache can, alternatively, be a write-through cache. With thismethod, everytime a processor writes to a cached memory location, boththe cache and the underlying memory location are updated. Cache writtendata may include any data, for example, a user-modified document.

[0008] While the write-through policy is more recoverable than the writeback policy with respect to recovering from cache corruption, thewrite-back policy provides better performance at the risk of memoryintegrity, and are, therefore, prone to data loss due to cache errors.

[0009] In particular, where the write-back policy is utilized (i.e., newdata that is to be written to a memory location that is cached iswritten to the cache and not to the memory location, and the new data issaved—written back to memory—when the cache line needs to be used byanother memory location, for example), there is the risk that the cachemay be corrupted before new data is saved.

[0010] Data in the cache which matches the data in a correspondingmemory location is called clean data; and data in the cache which doesnot match the data in a corresponding memory location is called dirtydata.

SUMMARY OF THE INVENTION

[0011] In one aspect of the invention, a method for maintaining dirtydata is disclosed. This method comprises receiving a request to writedata to a memory location that is cached, and then actually writing thatdata to a plurality of cache lines and marking those cache lines asdirty lines.

[0012] In another aspect of the invention, a method for saving, orwriting back the dirty data to memory is disclosed. The method comprisesreading dirty data from a cache line, and determining if the dirty datais corrupt. If it is not corrupt, then the line is marked available, andall dirty data lines corresponding to the read dirty data line aremarked invalid.

BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The present invention is illustrated by way of example, and notby way of limitation, in the figures of the accompanying drawings and inwhich like reference numerals refer to similar elements and in which:

[0014]FIG. 1 is a block diagram illustrating a cache line in accordancewith embodiments of the invention.

[0015]FIG. 2 is a block diagram illustrating a memory and cache systemin accordance with embodiments of the invention.

[0016]FIG. 3 is a flowchart illustrating a method for caching data inaccordance with embodiments of the invention.

[0017]FIG. 4 is a flowchart illustrating a method for writing backselected dirty lines in accordance with embodiments of the invention.

DETAILED DESCRIPTION OF THE INVENTION

[0018] In one aspect of the invention, a cost-efficient method forprotecting dirty data in cache memories is provided. When an instructionto write data to a memory location is received, and that memory locationis a cached memory location, the data is instead written to a pluralityof associated cache lines. When data is written back to memory, one ofthe associated cache lines is read. If the cache line is not corrupt, itis written back to the appropriate memory location and marked as clean.In one embodiment, if associated cache lines exist, they areinvalidated. In another embodiment, the other associated cache lines maybe read for the highest confidence of reliability, and then invalidated.

[0019] The present invention includes various operations, which will bedescribed below. The operations of the present invention may beperformed by hardware components or may be embodied inmachine-executable instructions, which may be used to cause ageneral-purpose or special-purpose processor or logic circuitsprogrammed with the instructions to perform the operations.Alternatively, the operations may be performed by a combination ofhardware and software.

[0020] The present invention may be provided as a computer programproduct which may include a machine-readable medium having storedthereon instructions which may be used to program a computer (or otherelectronic devices) to perform a process according to the presentinvention. The machine-readable medium may include, but is not limitedto, floppy diskettes, optical disks, CD-ROMs (Compact Disc-Read OnlyMemories), and magneto-optical disks, ROMs (Read Only Memories), RAMs(Random Access Memories), EPROMs (Erasable Programmable Read OnlyMemories), EEPROMs (Electromagnetic Erasable Programmable Read OnlyMemories), magnetic or optical cards, flash memory, or other type ofmedia/machine-readable medium suitable for storing electronicinstructions.

[0021] Moreover, the present invention may also be downloaded as acomputer program product, wherein the program may be transferred from aremote computer (e.g., a server) to a requesting computer (e.g., aclient) by way of data signals embodied in a carrier wave or otherpropagation medium via a communication link (e.g., a modem or networkconnection). Accordingly, herein, a carrier wave shall be regarded ascomprising a machine-readable medium.

[0022] Introduction

[0023] Since caches are highly volatile and prone to error, theytypically have error detection capabilities. For example, to detect thecorruption of data, parity checking may be used. In parity checking, aparity bit is used to check for errors in groups of transferred databits. In parity checking, the number of ones in each successfullytransmitted set of bits must be an odd or even number (depending on theimplementation). Failure of a parity check results in an errorindicating that the transmitted data is corrupt.

[0024] When data in a cache becomes corrupted, the data can be recoveredusing error correction or replacement capabilities. For example, Hammingcodes can be used to correct errors, and duplication may be used toreplace errors. While Hamming codes can be used to correct errors, theycan become costly as the number of bits to correct increases. Likewise,while duplication can be a reliable method of data recovery, it, too,can be a very costly mechanism since it entails storing multiple copiesof all data. For example, if one bit is stored in memory, two bits ofthe same value are stored in the cache. If an error is detected in onecopy, the copy is thrown away, and the other copy may be used.

[0025] Another mechanism that can be used is similar to a redundantarray of individual disks (RAID) approach. This mechanism is a diskdrive arrangement that uses a parity drive. Thus, if there are n drives,the n+1 drive is a parity of the other n. Analogously, a cache memorycan be segregated into n slices, and the RAID approach would require ann+1 slice to be a parity of the other n slices. Like data duplication,this method of data recovery is a very costly mechanism, in addition tobeing logically complex.

[0026] In embodiments of the invention, dirty data duplication is usedto duplicate dirty cache lines only, as opposed to duplication of allcache lines. Dirty data duplication is effective under the presumptionthat the chances of multiple copies of the dirty data becoming corruptin the cache are much lower than the chances of only a single copybecoming corrupt in the cache.

[0027] Caching

[0028] When an instruction to write data to a cached memory location isreceived, the data is written to a plurality of associated cache lines.In described embodiments, a four way set-associative cache is usedwhereby a single memory location may be indexed to any one of four cachelines in the cache. Furthermore, in described embodiments, data isduplicated to two cache lines.

[0029] However, the invention is not limited to any particular number ofduplicated cache lines, except that the number of cache lines is greaterthan one. Moreover, the invention is not limited to a four wayset-associative cache, nor is it limited to a set-associative cache. Forinstance, embodiments of the invention may be described with respect toa two way set-associative cache.

[0030] Illustrative Cache Line

[0031] As illustrated in FIG. 1, a cache line Cx 100, where x is adescriptive cache line number, comprises a valid bit 102, state bits104, a tag address 106, data 108, and checkbits 110. The valid bit isused to determine the content of the data. If the data is valid, it maybe clean data or dirty data, and if it is invalid, it may be used tostore data. Since clean data matches data in the corresponding memorylocation, and thus may be overwritten (while dirty data should never beoverwritten since it is a different and more recent copy than what isstored in main memory), a valid bit indicates that the data contained inthe cache line should at least be considered, whereas an invalid bitindicates that the line can be used without consideration. As usedherein, both clean cache lines and invalid cache lines are considered tobe available cache lines.

[0032] The state bits are used to determine the type of data stored inthe cache line. For instance, the state of the data may be clean ordirty. While other states may exist, they are omitted from discussionherein so as to not obscure the invention at hand. The tag addresscomprises the memory location to which the data corresponds, and thecheckbits comprise bits for error detection. If the checkbits detect anerror, then the data is said to be corrupt; otherwise, the data isuncorrupt.

[0033] Associated Set and Duplicates

[0034] An associated set is a set of n cache lines, where n is thenumber corresponding to an n-way set-associative cache. As each cachedmemory location corresponds to any one of n lines in an n-wayset-associative cache, the n lines are considered to be part of anassociated set. Thus, in described embodiments where four wayset-associative caches are illustrated, a given memory locationcorresponds to an associated set comprising four cache lines. Cachelines within an associated set are associated cache lines, and cachelines corresponding to the same memory location are duplicates.

[0035] Available Cache Lines

[0036] Available cache lines comprise those cache lines that are markedclean or invalid. This can be determined, for example, by examining thevalid bit in the cache line to determine whether or not it is set, andwithin the valid bit, what the state of the data is. If no availablecache lines exist, then write-back to memory occurs in accordance with areplacement policy to free up cache lines.

CACHING EXAMPLE

[0037] In a four way set-associative cache, all cache lines areassociated with one another such that a memory location can map to anyone of the four lines in the set, and can use any of the four lines inthe set for duplication, assuming they are available.

[0038] A caching example in accordance with embodiments of the inventionis illustrated in FIG. 2, where a memory 200 and a corresponding fourway set associative cache 202 is illustrated. In this example, C₁ 214,C₂ 216, C₃ 218, and C₄ 220 are associated with one another in anassociated set 230 (i.e., a given memory location can map to any one ofC₁ 214, C₂ 216, C₃ 218, and C₄ 220), and C₅ 222, C₆ 224, C₇ 226, and C₈228 are associated with one another in an associated set 232. Withinthese sets, the following are some possible combinations:

[0039] C₁ 214 is a duplicate of C₂ 216, and C₃ 218 is a duplicate of C₄220.

[0040] C₁ 214 and C₂ 216 are clean lines, and C₃ 218 is a duplicate ofC₄ 220.

[0041] C₁ 214, C₂ 216 C₃ 218, and C₄ 220 are all clean lines.

[0042] C₅ 222 is a duplicate of C₆ 224, and C₇ 226 and C₈ 228 are cleanlines.

[0043] C₅ 222 and C₆ 224 are clean lines, and C₇ 226 is a duplicate ofC₈ 228.

[0044] C₅ 222, C₆ 224, C₇ 226, C₈ 228 are all clean lines.

[0045] Of course, other combinations are possible, and are dynamic sincethe state of the lines (i.e., clean or dirty) may change during thecourse of cache reads and writes.

[0046] As an example, an instruction to write data to a memory 200 at amemory location that is cached 204, 206, 208, 210, 212 is received.Instead of writing the data to the memory location, it is written to twoavailable cache lines 214-228 in an associated set 230, 232 of thecorresponding cache 202. The two available cache lines in the set thenbecome duplicates.

[0047] For example, if the core processor (as opposed to a generalprocessor that typically includes the core processor and memory)receives an instruction to write data to memory location 206, and memorylocation 206 indexes to cache lines in associated set 230, then the acache controller could write to any two available cache lines in theassociated set 230. Thus, if cache lines 214 and 216 are available, thenthe controller would write to those two cache lines. Furthermore, if nocache lines are available, the cache controller would invoke areplacement policy (to be discussed) to free up cache lines.

[0048]FIG. 3 is a flowchart illustrating a method in accordance withFIG. 2. It begins at block 300 and continues to block 302 where aninstruction to write data to a cached memory location is received. Atblock 304, an associated set is determined. At block 306, it isdetermined if there is an available cache line in the associated set. Ifthere is, then at block 308, data is written to that line. At block 310,it is determined if duplication is complete (i.e., if a givenimplementation is to write data to two cache lines, then duplication iscomplete when two cache lines are written to).

[0049] If duplication is not complete, then the method repeats at block306. If no available cache line exists, then an available cache linemust be found through a replacement policy (to be discussed), and whenthat line is found, data is written to that line back at block 308. Ifduplication is complete, then the method ends at block 314.

[0050] The method is not restricted to the order described. The methodcould be performed in a different order. For example, It could first bedetermined if all available cache lines exist before data is written,rather than writing data to an available cache line as it is found.

[0051] Write-Backs

[0052] Write-backs occur to save cache data to main memory. FIG. 4 is aflowchart illustrating a write-back operation within general embodimentsof the invention. The method starts at block 400 and continues to block402 where a first dirty cache line is read for writing back to memory.It is determined if the cache line is corrupt at block 404.

[0053] Cache line is not corrupt: If the line is not corrupt, then thecache line is written back to a corresponding memory location at block414, as determined by the tag address of the cache line. At block 418,the cache line is marked available.

[0054] At blocks 408 and 410, an associated cache line corresponding tothe current memory location is searched for. A current memory locationcomprises a memory location that has not been written to yet, where thememory location corresponds to a first read dirty line in an associatedset. The current memory location gets reset when a memory location getswritten to. Thus, if the first dirty cache line corresponds to a memorylocation A, memory location A is set as the current memory location. Ifan associated dirty cache line corresponds to a memory location B, thenthe associated cache line does not correspond to the current memorylocation. If an associated dirty cache line corresponds to a memorylocation A, then it corresponds to the current memory location.

[0055] If the associated cache line corresponds to the current memorylocation 410 and the current memory location has already been written to412, then the associated cache line is marked invalid at block 406. Thisprocess is repeated until there are no more associated cache lines.

[0056] If the associated cache line corresponds to the current memorylocation 410 and the current memory location has not been written to412, then at block 414, the data is read, and the method repeats atblock 404 to determine if the data is corrupt.

[0057] If the associated cache line does not correspond to the currentmemory location 410, then another associated cache line is determined atblock 408 until a cache line corresponding to the current memorylocation is found.

[0058] Cache line is corrupt: If the cache line is corrupt at block 404,then at block 406, the line is marked invalid, and available for use. Atblock 408, it is determined if an associated cache line exists, and atblock 410 it is determined if the associated cache line corresponds tothe current memory location. If it does, and if the memory location hasnot been written to, then the line is read at block 414 to determine ifit is corrupt at block 404. If it is not corrupt, it is written to thecurrent memory location at block 416, and the line is marked availableat block 418.

[0059] If the current memory location has been written to, thenassociated cache lines are found and marked invalid. (However, even oncea memory location has been written back to, corresponding cache linesmay still be read to achieve a high confidence level that the data beingwritten back is valid. Using this approach, the lines may be markedaccordingly—i.e., if a line is not corrupt, it can be markedavailable—clean or dirty—and if a line is corrupt, it is marked invalid.While either implementation is within the scope of the invention,described embodiments use the former of these two implementations.) Whenno more associated cache lines exist, the method ends at block 420.

[0060] Replacement Policy

[0061] Write-backs may occur for any number of reasons as dictated by areplacement policy implemented for a given cache. A replacement policyis the policy that is used to identify cache lines to replace. Areplacement policy may dictate that clean lines are replaced first;dirty lines are replaced first; all lines are replaced; younger linesare replaced first; or least recently used (LRU) lines are replacedfirst, for example.

[0062] Write-backs can occur, for example, on an as-needed basis whenany number of dirty cache lines are freed up for a certain purpose; orfor a context switch or a cache flush where all cache lines, clean anddirty, are written back, for example

[0063] Thus, in a four way set-associative cache, each of the four linesin an associated set is read. Generally, if data on a cache line is notcorrupt, it is written to memory and marked available, and if it iscorrupt, it is not written to memory and marked invalid. Thedetermination of whether an available line is marked clean or invalid isimplementation and/or situation dependent.

[0064] If the line is a dirty line and the data is corrupt, it is markedinvalid, and a duplicate line is searched for. This process is repeateduntil no more duplicate lines exist, or until a duplicate line havinguncorrupt data is found. A duplicate line having uncorrupt data iswritten back and then marked available.

[0065] Conclusion

[0066] A mechanism has been described for writing data to and from acache for cost-efficiently protecting dirty data. The mechanism can beimplemented with little modification to existing cache architectures,and minimal modification to existing core processors. Error correctionis extended to cover failures over a large number of bits without fullduplication or the use of logically complex schemes such as the RAIDapproach.

[0067] Furthermore, the mechanism is congruent with existing methods ofdata recovery. For example, in an implementation where both dirty cachelines are read to achieve a high confidence of valid data, if the secondcache line is corrupt, it can be scrubbed using the uncorrupt data fromthe first cache line. As another example, if one of the cache linesbecomes permanently non-functional, the capability to run the cache indegraded mode means that the part of the cache containing thenon-functional cache line may be ignored with the advantage that thefirst cache line is not functional, and may contains good data.

[0068] In the foregoing specification, the invention has been describedwith reference to specific embodiments thereof. It will, however, beevident that various modifications and changes may be made theretowithout departing from the broader spirit and scope of the invention.The specification and drawings are, accordingly, to be regarded in anillustrative rather than a restrictive sense.

What is claimed is:
 1. A method for maintaining dirty data comprising:a. receiving a request to write data to a memory location that is cachedto a cache; b. writing the data to a plurality of cache lines in thecache, the plurality of cache lines written to being duplicate cachelines; and c. marking the duplicate cache lines dirty.
 2. The method ofclaim 1, wherein the cache is a multi-way set-associative cache.
 3. Amethod for saving dirty data comprising: a. reading data from a firstdirty cache line in a plurality of cache lines in a cache, the firstdirty cache line corresponding to a first memory location; b.determining if the data is corrupt; and c. if the data is not corrupt,then: i. writing the data to the first memory location; ii. marking thecache line available; iii. determining at least one duplicate dirtycache line of the first dirty cache line; and iv. marking each of the atleast one duplicate dirty cache line as an available cache line.
 4. Themethod of claim 3, wherein each of the duplicate dirty cache lines ismarked invalid.
 5. The method of claim 3, additionally comprisingreading each of the duplicate dirty cache lines and marking a duplicatecache line invalid if the data is corrupt.
 6. The method of claim 3,additionally comprising: a. if the data on the first dirty cache line iscorrupt, then marking the cache line invalid, and determining if aduplicate cache line exists; b. if a duplicate cache line exists, thendetermining if the data is corrupt, and if the data is not corrupt,then: i. writing the data to the first memory location; and ii. markingthe first dirty cache line available; and c. if a duplicate cache lineexists, and the data is corrupt, then repeating the method at (a) untilone of the following occurrences: i. a duplicate cache line having datathat is not corrupt is found; and ii. no more duplicate cache linesexist.
 7. The method of claim 4, additionally comprising if a duplicatecache line is not found, then terminating the method.
 8. A method forsaving dirty data comprising: a. reading data from a first cache line ina plurality of cache lines in a cache, the first cache linecorresponding to a first memory location; b. determining if the firstcache line is a clean line; c. determining if the data is corrupt; andd. if the data is not corrupt, and the first cache line is not a cleanline, then: i. writing the data to the first memory location; ii.marking the first cache line available; and iii. determining at leastone duplicate dirty cache line of the first dirty cache line and markingeach of the at least one duplicate dirty cache line invalid.
 9. Themethod of claim 8, additionally comprising if the data is corrupt, andthe first cache line is not clean, then: a. marking the cache lineinvalid, and determining if a duplicate cache line exists; b. if aduplicate cache line exists, then determining if the data is corrupt,and if the data is not corrupt, then: i. writing the data to the firstmemory location; and ii. marking the first cache line available; and c.if a duplicate cache line exists, and the data is corrupt, thenrepeating the method starting at (a) until one of the followingoccurrences: i. a duplicate cache line having data that is not corruptis found;and ii. no more duplicate cache lines exist.
 10. The method ofclaim 9, additionally comprising if a duplicate cache line is not found,then terminating the method.
 11. The method of claim 10, additionallycomprising if the data is corrupt, and the first cache line is clean,then repeating the method starting at 8(a) until no more associatedcache lines exist.
 12. A machine-readable medium having stored thereondata representing sequences of instructions, the sequences ofinstructions which, when executed by a processor, cause the processor toperform the following: receive an instruction to write data to a memorylocation in a memory that is cached to a cache; write the data to aplurality of cache lines in the cache, the plurality of cache lineswritten to being duplicate cache lines; and mark the duplicate cachelines as dirty.
 13. The machine-readable medium of claim 12, wherein thecache is a multi-way set-associative cache.
 14. A machine-readablemedium having stored thereon data representing sequences ofinstructions, the sequences of instructions which, when executed by aprocessor, cause the processor to perform the following: receive aninstruction to write back at least one dirty cache line to a memory;select a first dirty cache line of a plurality of cache lines in a cacheto write back to the memory; determine a corresponding memory locationin the memory to write back to by examining a tag portion of the firstdirty cache line; determine if the first dirty cache line has data thatis corrupt; writing the data back to the memory if the data is notcorrupt, and marking the first dirty cache line available; anddetermining at least one duplicate dirty cache line of the first dirtycache line and marking the at least one duplicate dirty cache lineinvalid.
 15. The machine-readable medium of claim 14, additionallycausing the processor to perform the following: if the first dirty cacheline has data that is corrupt, then mark the first dirty cache line asinvalid, and determine if any duplicate dirty cache lines of the firstdirty cache line have data that is not corrupt; if any one of theduplicate dirty cache lines has data that is not corrupt, then: writethe data from the one duplicate dirty cache line to a correspondingmemory location; mark the one duplicate dirty cache line available; andmark the other duplicate dirty cache lines invalid.
 16. Themachine-readable medium of claim 15, wherein the cache is a multi-wayset-associative cache.
 17. A machine-readable medium having storedthereon data representing sequences of instructions, the sequences ofinstructions which, when executed by a processor, cause the processor toperform the following: a. receive an instruction to write back at leastone cache line to a memory; b. select a cache line of a plurality ofcache lines in an associated set of a cache to write back to the memory;c. determine if the cache line is a clean line; d. determine acorresponding memory location in the memory to write back to byexamining a tag portion of the cache line; e. determining if the cacheline has data that is not corrupt; f. if the data is not corrupt, thenmarking the cache line available, and: i. writing the data back to thememory; ii. determining if the cache line was a dirty cache line; iii.if the cache line was a dirty cache line, then determining at least oneduplicate dirty cache line of the first dirty cache line and marking theat least one duplicate dirty cache line invalid; and iv. if the cacheline was not a dirty cache line, then repeating the method at 17(b)until no more associated cache lines exist.
 18. The machine-readablemedium of claim 17, additionally comprising if the data is corrupt, thenmarking the line invalid, and: a. if the cache line is a dirty cacheline, determining at least one duplicate dirty cache line of the firstdirty cache line, and repeating the method starting at 17(e) for a givenone of the at least one dirty cache line until one of the followingoccurs: i. a duplicate dirty cache line having data that is not corruptis found; and ii. no more duplicate cache lines exist; and b. if thecache line is not a dirty cache line, then repeating the method startingat 17(b).
 19. The machine-readable medium of claim 18, wherein the cacheis a multi-way set-associative cache.
 20. An apparatus comprising acache controller to: intercept a request to write data to a cachedmemory location; determine an associated set having cache lines, theassociated set corresponding to the memory location; and write the datato a plurality of cache lines in the associated set that are available.21. The apparatus of claim 20, further comprising invoking a replacementpolicy of the cache to free up cache lines in the associated set ifthere are no cache lines available.
 22. A system comprising: a mainmemory having at least one memory location that is cached to a cache; acache having a plurality of cache lines to store data; and a processorto receive an instruction to write data to a cached memory location; acache controller to determine an associated set corresponding to thememory location, the associated set having a plurality of cache lines,and to write the data to a plurality of available cache lines in theassociated set.
 23. The system of claim 22, the cache controller toadditionally invoke a replacement policy of the cache to free up cachelines in the associated set if no available cache lines in theassociated set are available.
 24. A system comprising: a main memoryhaving at least one memory location that is cached to a cache; a cachehaving a plurality of cache lines to store data; and a first means toreceive an instruction to write data to a cached memory location; asecond means to determine an associated set corresponding to the memorylocation, the associated set having a plurality of cache lines; and athird means to write the data to a plurality of available cache lines inthe associated set.